home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / qwik41.arc / QWIKDEMO.PAS < prev    next >
Pascal/Delphi Source File  |  1989-06-12  |  19KB  |  561 lines

  1. { QwikDemo.pas - Demo program for QWIK screen utilities.    ver 4.1, 05-01-88 }
  2. { Demo has been programmed best for color cards.  EGA and VGA should be in
  3.   25-line mode. }
  4.  
  5. program QwikDemo;
  6.  
  7. {$R-,S-,I-,D-,T-,F-,V-,B-,N-,L+ }
  8. {$M 12000, 0, 0}
  9.  
  10. uses
  11.   Crt,Qwik;
  12.  
  13. type
  14.   BrdrRec = record                 { For Qbox procedure }
  15.               TL,TH,TR,LV,RV,BL,BH,BR: char;
  16.             end;
  17.  
  18. var
  19.   Row,Rows,Col,Cols,Step,ColMax: byte;
  20.   i,Count,
  21.   OldCursor,Fgrnd,Bgrnd:       word;
  22.   BrdrAttr, WndwAttr:          integer;
  23.   SavedBlock, PopUpBlock: array [1..4000] of byte;
  24.   BlkRow,BlkCol,V:               byte;
  25.   ColL,ColR: array [1..3] of byte;
  26.   Strng,Strng2,NumStr:   string[75];
  27.   Data: array [1..9 ] of string[40];
  28.   PC:   array [1..13] of string[40];
  29.   Init: array [1.. 9] of string[40];
  30.   Other:array [1..14] of string[40];
  31.   Mores:array [1.. 4] of string[40];
  32.   Rnum:                  Real;
  33.   Ch:                    char;
  34.   LastVideoMode:         byte;
  35.  
  36. const      { These are double lines for Qbox }
  37.   Border: BrdrRec =  (TL:'╔';TH:'═';TR:'╗';
  38.                       LV:'║';       RV:'║';
  39.                       BL:'╚';BH:'═';BR:'╝');
  40.   BWcolors: array[0..3] of byte = (
  41.               0,    { Black     on Black }
  42.               7,    { LightGray on Black }
  43.             $0F,    { White     on Black }
  44.             $70);   { Black     on LightGray }
  45.   Wait: word = 500;           { One unit of wait in milliseconds for demo. }
  46.  
  47. { Qbox is an application of QWIK screen utilities.  It can make fast
  48.   pop-up menus.  See WINDOWxx.ARC for more applications. }
  49. procedure Qbox (Row,Col,Rows,Cols: byte; WndwAttr,BrdrAttr: integer;
  50.                                                       Brdr: BrdrRec);
  51. begin
  52.   if (Rows>=2) and (Cols>=2) then
  53.   begin
  54.     with Brdr do
  55.     begin
  56.       Qwrite     (Row       ,Col                     ,BrdrAttr,TL);
  57.       QfillMore  (                           1,Cols-2,BrdrAttr,TH);
  58.       QwriteMore (                                    BrdrAttr,TR);
  59.       Qfill      (Row+1     ,Col       ,Rows-2,1     ,BrdrAttr,LV);
  60.       Qfill      (Row+1     ,Col+Cols-1,Rows-2,1     ,BrdrAttr,RV);
  61.       Qwrite     (Row+Rows-1,Col                     ,BrdrAttr,BL);
  62.       QfillMore  (                           1,Cols-2,BrdrAttr,BH);
  63.       QwriteMore (                                    BrdrAttr,BR);
  64.       Qfill      (Row+1     ,Col+1     ,Rows-2,Cols-2,WndwAttr,' ')
  65.     end
  66.   end
  67. end;
  68.  
  69. procedure PromptKey;
  70. begin
  71.   Qwrite (25,CRTcols-19,SameAttr,'press any key ...');
  72.   Ch:=ReadKey;
  73.   if Ch=#00 then Ch:=ReadKey;
  74. end;
  75.  
  76. procedure CheckCursor;
  77. var CursorMode: integer absolute $0040:$0060;
  78. begin
  79.   if ActiveDispDev=MdaMono then
  80.     if CursorMode=$0607 then
  81.       CursorChange($0B0C,OldCursor);
  82. end;
  83.  
  84. procedure ClearScreen (Attr: integer);
  85. begin
  86.   Qfill ( 1, 1,CRTrows,CRTcols,Attr,' ');
  87. end;
  88.  
  89. procedure DisableInterrupts; inline($FA);  { CLI }
  90. procedure EnableInterrupts;  inline($FB);  { STI }
  91.  
  92. procedure ExplodeScreen;
  93. var
  94.   TopRow,BottomRow,MaxRows,MaxCols,DeltaCols,LeftCol,RightCol: byte;
  95.   CenterCol: byte;
  96.   ClockReading: longint absolute $0040:$006C; { low memory clock }
  97.   StartTime,ElapsedTime: longint;
  98.  
  99. {}procedure ScatterBoxes;
  100. {}begin
  101. {}  Rows:= succ(random(MaxRows));
  102. {}  if VideoMode<=CO40 then               { Keep aspect 1:1 }
  103. {}       Cols:= Rows + Rows shr 2         { 1.2 cols/row }
  104. {}  else Cols:= Rows shl 1 + Rows shr 1;  { 2.4 cols/row }
  105. {}  Col := LeftCol + random (RightCol-LeftCol-Cols+2);
  106. {}  Row := TopRow  + random (BottomRow-TopRow-Rows+2);
  107. {}  if VideoMode=Mono then
  108. {}  TextAttr:=BWcolors[(random(4))]
  109. {}  else
  110. {}    begin
  111. {}      Fgrnd:= random (16);
  112. {}      Bgrnd:= random (8);
  113. {}      if Bgrnd=Fgrnd then inc(Fgrnd);
  114. {}      TextAttr:=Fgrnd + Bgrnd shl 4;
  115. {}    end;
  116. {}  Qfill (Row,Col,Rows,Cols,TextAttr,#178);
  117. {}end;
  118.  
  119. begin
  120.   CenterCol:=CRTcols shr 1;
  121.   randomize;
  122.   DisableInterrupts;
  123.   StartTime:=ClockReading;
  124.   EnableInterrupts;
  125.   for Step:=1 to 12 do
  126.     begin
  127.       { Set boundaries }
  128.       TopRow:=13-Step;
  129.       BottomRow:=13+Step;
  130.       MaxRows:=Step;
  131.       if VideoMode<=CO40 then                      { Keep aspect 1:1 }
  132.         begin
  133.           MaxCols:= MaxRows + MaxRows shr 2;       { 1.2 cols/row }
  134.           DeltaCols:=(Step*5 div 3);
  135.         end
  136.       else
  137.         begin
  138.           MaxCols:= MaxRows shl 1 + MaxRows shr 1;  { 2.4 cols/row }
  139.           DeltaCols:=(Step*10 div 3);
  140.         end;
  141.       LeftCol  :=succ(CenterCol)-DeltaCols;
  142.       RightCol :=CenterCol+DeltaCols;
  143.       if Step<12 then
  144.         begin
  145.           for Count:=1 to 40 do ScatterBoxes;
  146.         end
  147.       else
  148.         repeat
  149.           ScatterBoxes;
  150.           DisableInterrupts;
  151.           ElapsedTime:=ClockReading-StartTime;
  152.           EnableInterrupts;
  153.         until ElapsedTime>=60;  { about 60/18.2 seconds }
  154.     end;
  155. end;
  156.  
  157. begin
  158. { --- Set up data --- }
  159. { If you set a mode, do it first before Qinit! }
  160. { Please!  Test a mode first to see if it is different than what you want; }
  161. { then change if necessary.  Otherwise, the screen jumps. }
  162.  
  163.   LastVideoMode:=VideoMode;
  164.   if (VideoMode<>Mono) and not Have3270 then
  165.     begin
  166.       ClearScreen (LightGray+BlackBG);
  167.       QwriteC (11,1,CRTcols,SameAttr,'(1) 40 column mode');
  168.       QwriteC (12,1,CRTcols,SameAttr,'(2) 80 column mode');
  169.       QwriteC (14,1,CRTcols,SameAttr,'Which mode [1,2]? ');
  170.       GotoRC  (14,CRTcols div 2 + 9);
  171.       repeat
  172.         Ch:=ReadKey;
  173.       until ch in ['1','2'];
  174.       V:=VideoMode;
  175.       case ch of
  176.         '1': case V of
  177.                BW80: V:=BW40;
  178.                CO80: V:=CO40;
  179.              end;
  180.         '2': case V of
  181.                BW40: V:=BW80;
  182.                CO40: V:=CO80;
  183.              end;
  184.       end;
  185.       if V<>VideoMode then
  186.         begin
  187.           TextMode(V);
  188.           Qinit;           { << Do Qinit again after change of mode!! }
  189.         end;
  190.     end;
  191.   Strng:=   ' Q Screen Utilities ';
  192.   Strng2:=  ' QWIK Screen Utilities  ';
  193.   Data[1]:= '1';
  194.   Data[2]:= '22';
  195.   Data[3]:= '333';
  196.   Data[4]:= Strng;
  197.   Data[5]:= 'Odd  Length';
  198.   Data[6]:= 'Even  Length';
  199.   Data[7]:= '18 characters wide';
  200.   Data[8]:= '19 characters width';
  201.   Data[9]:= 'Margin to Margin width';
  202.   PC[1]:=  'COMPUTERS:           ADAPTERS:';
  203.   PC[2]:=  '------------------   ----------';
  204.   PC[3]:=  'IBM PC               MDA';
  205.   PC[4]:=  'IBM XT               CGA';
  206.   PC[5]:=  'IBM AT               EGA';
  207.   PC[6]:=  'IBM PCjr             MCGA';
  208.   PC[7]:=  'IBM PC Convertible   VGA';
  209.   PC[8]:=  'IBM PS/2 Model 25    8514/A';
  210.   PC[9]:=  'IBM PS/2 Model 30    Hercules:';
  211.   PC[10]:= 'IBM PS/2 Model 50      HGC';
  212.   PC[11]:= 'IBM PS/2 Model 60      HGC Plus';
  213.   PC[12]:= 'IBM PS/2 Model 80      InColor';
  214.   PC[13]:= 'IBM 3270 PC';
  215.   Other[1]:='QwriteA    - for arrays/partial strings';
  216.   Other[2]:='QfillC     - a self-centering Qfill';
  217.   Other[3]:='QattrC     - a self-centering Qattr';
  218.   Other[4]:='QviewPage  - view any video page';
  219.   Other[5]:='QwritePage - write to any video page';
  220.   Other[6]:='';
  221.   Other[7]:='GotoRC       - position absolute cursor';
  222.   Other[8]:='CursorChange - change cursor shape';
  223.   Other[9]:='CursorOff    - turns off cursor';
  224.   Other[10]:='CursorOn     - turns on  cursor';
  225.   Other[11]:='WhereR       - absolute cursor row';
  226.   Other[12]:='WhereC       - absolute cursor column';
  227.   Other[13]:='A total of 23 utilities';
  228.   Other[14]:='compiling in only 1.7k bytes!';
  229.   Init[1]:='∙ Detects dual monitor/adapters for all';
  230.   Init[2]:='   systems listed on the previous page';
  231.   Init[3]:='∙ Identifies each system by name';
  232.   Init[4]:='∙ Gets System ID and Submodel ID';
  233.   Init[5]:='∙ Gets CPU ID';
  234.   Init[6]:='∙ Sets video buffer segment';
  235.   Init[7]:='∙ Determines need for wait-for-retrace';
  236.   Init[8]:='∙ Gets screen dimensions: Rows by Cols';
  237.   Init[9]:='∙ Determines the number of video pages';
  238.   Mores[1]:=' ∙ QwriteMore  - just like Qwrite  ';
  239.   Mores[2]:=' ∙ QwriteMoreA - just like QwriteA ';
  240.   Mores[3]:=' ∙ QfillMore   - just like Qfill   ';
  241.   Mores[4]:=' ∙ QattrMore   - just like Qattr   ';
  242.  
  243. { --- Initial screen --- }
  244.   CheckCursor;
  245.   CursorOff;
  246.  
  247.   ClearScreen (White+BlueBG);
  248.   QwriteC (11, 1,CRTcols,Yellow+BlueBG,Strng2);
  249.   QwriteC (13, 1,CRTcols,SameAttr,'Your screen is about to explode.');
  250.   QwriteC (14, 1,CRTcols,SameAttr,'Hold on to your seat ...');
  251.   Delay   (Wait*5);
  252.  
  253. { --- Explosion of Boxes --- }
  254.   ClearScreen (Black+LightGrayBG);
  255.   ExplodeScreen;
  256.  
  257.   QfillC  (10, 1,CRTcols, 6,34,RedBG  ,' ');
  258.   QfillC  (11, 1,CRTcols, 4,30,BrownBG,' ');
  259.   TextAttr:= Yellow+RedBG;
  260.   QwriteC (12, 1,CRTcols,TextAttr,Strng2);
  261.   QwriteC (13, 1,CRTcols,TextAttr,'      Version  4.1      ');
  262.  
  263.   { --- Save Screen for Page Demo --- }
  264.   if MaxPage>0 then
  265.    begin
  266.      QstoreToMem ( 1, 1,25,CRTcols,SavedBlock);
  267.      QwritePage  (1);
  268.      QstoreToScr ( 1, 1,25,CRTcols,SavedBlock);
  269.      QwritePage  (0);
  270.    end;
  271.   { --- End of Save Screen --- }
  272.   Delay   (Wait*4);
  273.   TextAttr:= White+BlueBG;
  274.   QwriteC ( 6, 1,CRTcols,TextAttr,' Qwrite will write with new attributes  ');
  275.   QwriteC ( 7, 1,CRTcols,TextAttr,' that you specify direct to the screen. ');
  276.   Delay   (Wait*6);
  277.   QwriteC (18, 1,CRTcols,SameAttr,'Qwrite will also use existing attributes');
  278.   QwriteC (19, 1,CRTcols,SameAttr,'   when you do not even know or care.   ');
  279.                         { highlight the word 'existing' }
  280.   QattrC  (18, 6,CRTcols+5,1,10,White+RedBG+Blink);
  281.   Delay   (wait*10);
  282.   QwriteC (21, 1,CRTcols,TextAttr,' Say Goodbye to this screen. ');
  283.  
  284.   Delay   (wait*3);
  285.   { --- Disintigrate Screen --- }
  286.   for i:=1 to 5000 do
  287.   begin
  288.     Row:=random(25)+1;
  289.     Col:=random(CRTcols)+1;
  290.     Qfill (row,col, 1, 1,Black,' ');
  291.   end;
  292.  
  293. { --- Compatible computer and adapter list --- }
  294.   ClearScreen (LightGrayBG);
  295.   QwriteC ( 4, 1,CRTcols,SameAttr,'QWIK Screen Utilities detects these IBM');
  296.   QwriteC ( 5, 1,CRTcols,SameAttr,'or compatible computers and adapters:');
  297.   delay   (wait*5);
  298.   Col:=(CRTcols-30) shr 1;
  299.   for Row:=7 to 19 do
  300.     Qwrite (Row,Col,SameAttr,PC[Row-6]);
  301.   QwriteC ( 22, 1,CRTcols,SameAttr,'Working text modes 0,1,2,3, or 7!');
  302.   PromptKey;
  303.  
  304. { --- Qinit detection --- }
  305.   ClearScreen (LightGrayBG);
  306.   QwriteC ( 4, 1,CRTcols,SameAttr,'To configure QWIK, Qinit not only');
  307.   QwriteC ( 5, 1,CRTcols,SameAttr,'detects computers/adapters, it:');
  308.   delay   (wait*5);
  309.   Col:=(CRTcols-36) shr 1;
  310.   for Row:=10 to 18 do
  311.     Qwrite (Row,Col,SameAttr,Init[Row-9]);
  312.   PromptKey;
  313.  
  314. { --- Qwrite with Str on Reals Demo --- }
  315.   ClearScreen (Yellow+BlackBG);
  316.   QwriteC ( 2, 1,CRTcols,SameAttr,'Qwrite with Turbo''s Str will write');
  317.   QwriteC ( 3, 1,CRTcols,SameAttr,'reals and integers faster:');
  318.   Delay   (wait*7);
  319.   Rnum:=1.23E+05;
  320.   for col:=0 to CRTcols div 20 -1 do
  321.   for row:=5 to 24 do
  322.   begin
  323.     Rnum:=Rnum+1;
  324.     Str(Rnum:12,NumStr);
  325.     Qwrite (row,col*20+4,SameAttr,NumStr);
  326.   end;
  327.   PromptKey;
  328.  
  329. { --- Centering Demo --- }
  330.   ClearScreen (LightGrayBG);
  331.   QwriteC ( 2, 1,CRTcols,SameAttr,'QwriteC will automatically');
  332.   QwriteC ( 3, 1,CRTcols,SameAttr,'center your data ...');
  333.   QwriteC ( 4, 1,CRTcols,SameAttr,'(Odd breaks are shifted to the left.)');
  334.   Delay   (wait*6);
  335.  
  336.   { - Set up columns for varying column modes - }
  337.   ColL[2]:=1; ColR[2]:=CRTcols;
  338.   if CRTcols<80 then
  339.   begin
  340.     ColL[1]:=ColL[2]; ColL[3]:=CRTcols div 2;
  341.     ColR[1]:=ColR[2]; ColR[3]:=CRTcols div 2;
  342.   end
  343.   else
  344.   begin
  345.     ColL[1]:=3; ColR[1]:=26; ColL[3]:=CRTcols-14; ColR[3]:=CRTcols-14;
  346.   end;
  347.  
  348.   QwriteC ( 7,ColL[1],ColR[1],SameAttr,'between margins ...');
  349.   Qbox    ( 8,(ColL[1]+ColR[1]) shr 1 -12,15,26,white,LightGray,Border);
  350.   Delay   (wait*3);
  351.   for row:=11 to 19 do
  352.     QwriteC (row,ColL[1],ColR[1],SameAttr, Data[row-10]);
  353.   Delay   (wait*5);
  354.  
  355.   QwriteC ( 7,ColL[2],ColR[2],SameAttr,'between two columns ...');
  356.   QfillC  ( 9,ColL[2],ColR[2],13,24,Yellow,' ');     {  Clear window }
  357.   for row:= 9 to 21 do
  358.     QwriteC  (row,ColL[2],ColR[2],SameAttr,'><');     {  Show two columns  }
  359.   Delay   (wait*3);
  360.   for row:=11 to 19 do
  361.     QwriteC (row,ColL[2],ColR[2],LightRed, Data[row-10]);
  362.   Delay   (wait*5);
  363.  
  364.   QwriteC ( 7,ColL[3],ColR[3],SameAttr,'or on a center line ...');
  365.   QfillC  ( 8,ColL[3],ColR[3],15,27,Black+LightGrayBG,' ');  {Clear window}
  366.   for row:=09 to 21 do                 {  Show center line  }
  367.     QwriteC  (row,ColL[3],ColR[3],Black+LightGrayBG,'|');
  368.   Delay   (wait*3);
  369.   for row:=11 to 19 do
  370.     QwriteC (row,ColL[3],ColR[3],SameAttr, Data[row-10]);
  371.   PromptKey;
  372.  
  373. { --- Qfill Demo --- }
  374.   ClearScreen (White+BlackBG);
  375.   QwriteC ( 2, 1,CRTcols,SameAttr,'Qfill as well as Qattr can fill');
  376.   QwriteC ( 3, 1,CRTcols,SameAttr,'your screen in several ways.');
  377.   Delay   (wait*7);
  378.  
  379.   QwriteC ( 7, 1,CRTcols,SameAttr,'by rows ...');
  380.   Delay   (wait*3);
  381.   for row:= 9 to 24 do
  382.     Qfill (row, 2, 1,CRTcols-2,9+row,Chr(row+56));
  383.   Delay   (wait*5);
  384.  
  385.   Qfill   ( 7, 1,19,CRTcols,white,' ');       {  Clear Lines }
  386.   QwriteC ( 7, 1,CRTcols,SameAttr,'by columns ...');
  387.   Delay   (wait*3);
  388.   for col:=2 to CRTcols-2 do
  389.     Qfill ( 9,col,16,1,16+col,chr(col+63));
  390.   Delay   (wait*5);
  391.  
  392.   Qfill   ( 7, 1,19,CRTcols,white,' ');       {  Clear Lines }
  393.   QwriteC ( 7, 1,CRTcols,SameAttr,'or by row-by-column blocks ...');
  394.   Delay   (wait*3);
  395.     Qfill ( 9,2,16,CRTcols-2,Yellow+BlueBG,'!');
  396.   Delay   (wait*5);
  397.  
  398. { --- Qbox demo --- }
  399.   ClearScreen (LightGrayBG);
  400.   QwriteC ( 2, 1,CRTcols,SameAttr,'Qbox is an application procedure made');
  401.   QwriteC ( 3, 1,CRTcols,SameAttr,'from Qwrite and Qfill.  Together they');
  402.   QwriteC ( 4, 1,CRTcols,SameAttr,'can make windows with borders easy.');
  403.   Delay   (wait*9);
  404.   QwriteC (14, 1,CRTcols,SameAttr,'How about 100 of them? ... ');
  405.   Delay   (wait*4);
  406.   ColMax:=CRTcols-21;
  407.   for i:=1 to 100 do
  408.   begin
  409.     row:=random (10)+6;
  410.     col:=random (ColMax)+2;
  411.     if VideoMode=Mono then
  412.       begin
  413.         BrdrAttr:=BWcolors[random(4)];
  414.         WndwAttr:=BWcolors[random(4)];
  415.       end
  416.     else
  417.       begin
  418.         BrdrAttr:=random (128);
  419.         WndwAttr:=random (128);
  420.       end;
  421.     Qbox (row,col,10,20,BrdrAttr,WndwAttr,Border);
  422.   end;
  423.   Delay   (wait*10);
  424.  
  425. { --- Block Transfer and PopUp Demo --- }
  426.   Qfill   ( 1, 1,25,CRTcols,yellow,'?');       {  Clear Screen }
  427.   QfillC  (10, 1,CRTcols, 6,40,BrownBG,' ');   {  Clear Block }
  428.   QwriteC (11, 1,CRTcols,SameAttr,'Qstore will save and restore');
  429.   QwriteC (12, 1,CRTcols,SameAttr,'Row-by-Column blocks on your display.');
  430.   QwriteC (13, 1,CRTcols,SameAttr,'It is so fast, I have to slow it down');
  431.   QwriteC (14, 1,CRTcols,SameAttr,'so you can see it.');
  432.     Delay (wait*11);
  433.     BlkRow:=8;
  434.     BlkCol:=CRTcols div 2 - 9;
  435.   QstoreToMem(BlkRow,BlkCol,10,20,SavedBlock);
  436.   { --- Make a Pop Up Menu --- }
  437.   Qbox (BlkRow,BlkCol,10,20,Yellow+BlueBG,Brown+BlueBG,Border);
  438.   QwriteC (BlkRow+4,BlkCol,BlkCol+20,SameAttr,'Pop Up');
  439.   QwriteC (BlkRow+5,BlkCol,BlkCol+20,SameAttr,'Menu');
  440.   { --- End of Pop Up Menu --- }
  441.   QstoreToMem (BlkRow,BlkCol,10,20,PopUpBlock);
  442.     Delay (wait*4);
  443.   ColMax:=CRTcols-20;
  444.   for i:=1 to 30 do
  445.   begin
  446.     Delay (Wait div 2);
  447.     QstoreToScr (BlkRow,BlkCol,10,20,SavedBlock);
  448.     BlkRow:=random(15)+1;
  449.     BlkCol:=random(ColMax)+1;
  450.     QstoreToMem (BlkRow,BlkCol,10,20,SavedBlock);
  451.     QstoreToScr (BlkRow,BlkCol,10,20,PopUpBlock);
  452.   end;
  453.  
  454. { --- Page Demo --- }
  455.   if MaxPage>0 then
  456.   begin
  457.     QviewPage  (1);
  458.     QwritePage (1);
  459.     TextAttr:= Yellow+BlueBG;
  460.     QfillC  (20, 1,CRTcols, 3,40,TextAttr,' ');
  461.     QwriteC (20, 1,CRTcols,SameAttr,' Remember this page?  ');
  462.     QwriteC (21, 1,CRTcols,SameAttr,' It wasn''t destroyed, but saved using ');
  463.     QwriteC (22, 1,CRTcols,SameAttr,' Qstores and placed on a new page. ');
  464.     Delay (wait*14);
  465.     QwritePage (0);
  466.     QviewPage  (0);
  467.   end;
  468.  
  469. { --- Q*More Utilities Demo --- }
  470.   ClearScreen (Black+LightGrayBG);
  471.   QwriteC ( 3, 1,CRTcols,SameAttr,'The Q*More procedures:');
  472.   for Row:=5 to 8 do
  473.     QwriteC (Row, 1,CRTcols,Yellow+BlackBG,Mores[Row-4]);
  474.   QwriteC (10, 1,CRTcols,SameAttr,'Allow you to add more to the last of');
  475.   QwriteC (11, 1,CRTcols,SameAttr,'any QWIK procedure.  No need for Row');
  476.   QwriteC (12, 1,CRTcols,SameAttr,'or Col.  Change Attr in midstream!  ');
  477.   delay   (wait*5);
  478.   Col := (CRTcols-38) shr 1;
  479.     Qwrite (14,Col,Black+BrownBG,' Yellow ');
  480.     for Count:=1 to 2 do
  481.       begin
  482.         delay      (wait);
  483.         QwriteMore (White+BlueBG ,'  Blue  ');
  484.         delay      (wait);
  485.         QwriteMore (Black+BrownBG,' Yellow ');
  486.       end;
  487.   delay   (wait);
  488.   QwriteC (16, 1,CRTcols,SameAttr,'Starts where the last QWIK');
  489.   QwriteC (17, 1,CRTcols,SameAttr,'procedure left off!');
  490.   QwriteC (18, 1,CRTcols,SameAttr,'Like TP Write ... but faster!');
  491.   delay   (wait*2);
  492.     Qwrite (21,Col,Black+BrownBG,' Yellow ');
  493.     for Count:=1 to 2 do
  494.       begin
  495.         QwriteMore (White+BlueBG ,'  Blue  ');
  496.         QwriteMore (Black+BrownBG,' Yellow ');
  497.       end;
  498.   PromptKey;
  499.  
  500. { --- Other Utilities Demo --- }
  501.   ClearScreen (White+BlackBG);
  502.   QwriteC ( 4, 1,CRTcols,SameAttr,'Here are more handy');
  503.   QwriteC ( 5, 1,CRTcols,SameAttr,'QWIK Screen Utilities:');
  504.   delay   (wait*5);
  505.   Col:=(CRTcols-38) shr 1;
  506.   for Row:=8 to 19 do
  507.     Qwrite (Row,Col,SameAttr,Other[Row-7]);
  508.   for Row:=21 to 22 do
  509.     QwriteC (Row,1,CRTcols,SameAttr,Other[Row-8]);
  510.   PromptKey;
  511.  
  512. { --- Attribute Demo --- }
  513.   ClearScreen (Green+GreenBG);
  514.   TextAttr:= White+GreenBG;
  515.   QwriteC ( 2, 1,CRTcols,TextAttr,'QWIK Screen Utilities are hiding data');
  516.   QwriteC ( 3, 1,CRTcols,TextAttr,'on your screen ...');
  517.   Cols:=CRTcols div 20;
  518.   if VideoMode=Mono then
  519.        TextAttr:=Black+BlackBG
  520.   else TextAttr:=Green+GreenBG;
  521.   for col:=0 to Cols-1 do
  522.     for row:=5 to 20 do
  523.       Qwrite (row,20*col+1,TextAttr,Strng);
  524.   Delay (wait*8);
  525.  
  526.   Qfill   ( 2, 1, 2,CRTcols,SameAttr,' ');        {  Clear Lines }
  527.   TextAttr:= White+GreenBG;
  528.   QwriteC ( 2, 1,CRTcols,TextAttr,'Qattr can show them -');
  529.   QwriteC ( 3, 1,CRTcols,TextAttr,'by merely changing the attribute!');
  530.   Delay   (wait*6);
  531.  
  532.   { --- Try using Turbo's color procedures this time --- }
  533.   TextColor (Black); TextBackground (Green);
  534.   Qattr   ( 5, 1,16,CRTcols,TextAttr);         {  Reveal Data }
  535.   Delay   (wait*5);
  536.  
  537.   Qfill   ( 2, 1, 2,CRTcols,SameAttr,' ');        {  Clear Lines }
  538.   TextColor (yellow); TextBackground (Green);
  539.   QwriteC ( 2, 1,CRTcols,TextAttr,'Or even just emphasize what''s seen ...');
  540.   for i:=1 to 500 do
  541.   begin
  542.     Row:= random(16) + 5;
  543.     Col:= random(Cols)*20+1;
  544.     Qattr (Row,Col, 1,20,46);
  545.     Delay (3);
  546.     Qattr (Row,Col, 1,20,32);
  547.   end;
  548.   for i:=1 to Cols do     {  Emphasize Data }
  549.     Qattr ( 5*i,(i-1)*20+1, 1,20,Yellow+GreenBG+Blink);
  550.   Qattr   (21, 1, 5,CRTcols,TextAttr);
  551.   QwriteC (22, 1,CRTcols,TextAttr,' (c) 1986-1988 James H. LeMay ');
  552.  
  553.   if VideoMode<=CO40 then
  554.     begin
  555.       delay (2000);
  556.       TextMode (LastVideoMode);
  557.     end;
  558.   GotoRC  (23, 1);
  559.   CursorOn;
  560. end.
  561.